package com.ybkj.chat.ui.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bigkoo.pickerview.builder.TimePickerBuilder;
import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.TimePickerView;
import com.ybkj.chat.R;
import com.ybkj.chat.ui.adapter.base.XBaseAdapter;
import com.ybkj.chat.ui.adapter.base.XBaseViewHolder;

import java.util.Date;

/**
 * @author yyj
 * @create 2019-02-15 16:20
 * @Describe
 */
public class CashAdapter extends XBaseAdapter<String> {

    private ImageView iv_calendar;

    public CashAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.recycle_cash_item;
    }

    @Override
    protected void convert(XBaseViewHolder helper, String item) {
        iv_calendar = helper.itemView.findViewById(R.id.iv_calendar);
        iv_calendar.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                TimePickerView pvTime = new TimePickerBuilder(mContext, new OnTimeSelectListener() {
                    @Override
                    public void onTimeSelect(Date date, View v) {

                    }
                })
                        .setType(new boolean[]{true,true,false,false,false,false})
                        .build();
                pvTime.show();
            }
        });
    }
}
